offset: BigEndianLong; { offset within SampleData - this could be just for internal use }
numSamples: BigEndianLong; { this could also just be for internal use, we'll see }
loopType: BigEndianLong;
loopStart: BigEndianLong;
loopEnd: BigEndianLong;
pitchNormal: BigEndianLong;
pitchLow: BigEndianLong;
pitchHigh: BigEndianLong;
END;
AtomicInstrument = Handle;
AtomicInstrumentPtr = Ptr;
CONST
kQTMIDIComponentType = 'midi';
kOMSComponentSubType = 'OMS ';
kFMSComponentSubType = 'FMS ';
kMIDIManagerComponentSubType = 'mmgr';
TYPE
QTMIDIComponent = ComponentInstance;
CONST
kMusicPacketPortLost = 1; { received when application loses the default input port }
kMusicPacketPortFound = 2; { received when application gets it back out from under someone else's claim }
kMusicPacketTimeGap = 3; { data[0] = number of milliseconds to keep the MIDI line silent }
kAppleSysexID = $11; { apple sysex is followed by 2-byte command. 0001 is the command for samplesize }
kAppleSysexCmdSampleSize = $0001; { 21 bit number in 3 midi bytes follows sysex ID and 2 cmd bytes }
kAppleSysexCmdSampleBreak = $0002; { specifies that the sample should break right here }
kAppleSysexCmdAtomicInstrument = $0010; { contents of atomic instrument handle }
kAppleSysexCmdDeveloper = $7F00; { F0 11 7F 00 ww xx yy zz ... F7 is available for non-Apple developers, where wxyz is unique app signature with 8th bit cleared, unique to developer, and 00 and 7f are reserved }
TYPE
MusicMIDIPacketPtr = ^MusicMIDIPacket;
MusicMIDIPacket = RECORD
length: UInt16;
reserved: UInt32; { if length zero, then reserved = above enum }
data: PACKED ARRAY [0..248] OF UInt8;
END;
{$IFC TYPED_FUNCTION_POINTERS}
MusicMIDISendProcPtr = FUNCTION(self: ComponentInstance; refCon: LONGINT; VAR mmp: MusicMIDIPacket): ComponentResult;
inputPortID: OSType; { terminology death: this port is used to SEND to the midi synth }
outputPortID: OSType; { terminology death: this port receives from a keyboard or other control device }
midiChannel: LONGINT; { The system channel; others are configurable (or the nubus slot number) }
flags: LONGINT;
unique: LONGINT; { unique id may be used instead of index, to getinfo and unregister calls }
reserved1: LONGINT; { should be zero }
reserved2: LONGINT; { should be zero }
END;
QTMIDIPortPtr = ^QTMIDIPort;
QTMIDIPort = RECORD
portConnections: SynthesizerConnections;
portName: Str63;
END;
QTMIDIPortListPtr = ^QTMIDIPortList;
QTMIDIPortList = RECORD
portCount: INTEGER;
port: ARRAY [0..0] OF QTMIDIPort;
END;
QTMIDIPortListHandle = ^QTMIDIPortListPtr;
FUNCTION QTMIDIGetMIDIPorts(ci: QTMIDIComponent; VAR inputPorts: QTMIDIPortListHandle; VAR outputPorts: QTMIDIPortListHandle): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $0001, $7000, $A82A;
{$ENDC}
FUNCTION QTMIDIUseSendPort(ci: QTMIDIComponent; portIndex: LONGINT; inUse: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $0002, $7000, $A82A;
{$ENDC}
FUNCTION QTMIDISendMIDI(ci: QTMIDIComponent; portIndex: LONGINT; VAR mp: MusicMIDIPacket): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $0003, $7000, $A82A;
{$ENDC}
FUNCTION QTMIDIUseReceivePort(ci: QTMIDIComponent; portIndex: LONGINT; readHook: MusicMIDIReadHookUPP; refCon: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $000C, $0004, $7000, $A82A;
{$ENDC}
CONST
kMusicComponentType = 'musi';
kInstrumentComponentType = 'inst';
kSoftSynthComponentSubType = 'ss ';
kGMSynthComponentSubType = 'gm ';
TYPE
MusicComponent = ComponentInstance;
{ MusicSynthesizerFlags }
CONST
kSynthesizerDynamicVoice = $01; { can assign voices on the fly (else, polyphony is very important }
kSynthesizerUsesMIDIPort = $02; { must be patched through MIDI Manager }
kSynthesizerMicrotone = $04; { can play microtonal scales }
kSynthesizerHasSamples = $08; { synthesizer has some use for sampled data }
kSynthesizerMixedDrums = $10; { any part can play drum parts, total = instrument parts }
kSynthesizerSoftware = $20; { implemented in main CPU software == uses cpu cycles }
kSynthesizerHardware = $40; { is a hardware device (such as nubus, or maybe DSP?) }
kSynthesizerDynamicChannel = $80; { can move any part to any channel or disable each part. (else we assume it lives on all channels in masks) }
kSynthesizerHogsSystemChannel = $0100; { can be channelwise dynamic, but always responds on its system channel }
kSynthesizerHasSystemChannel = $0200; { has some "system channel" notion to distinguish it from multiple instances of the same device (GM devices dont) }
kSynthesizerSlowSetPart = $0400; { SetPart() and SetPartInstrumentNumber() calls do not have rapid response, may glitch notes }
kSynthesizerOffline = $1000; { can enter an offline synthesis mode }
outputCount: UInt32; { number of audio outputs (usually two) }
latency: UInt32; { response time in µSec }
controllers: ARRAY [0..3] OF UInt32; { array of 128 bits }
gmInstruments: ARRAY [0..3] OF UInt32; { array of 128 bits }
gmDrums: ARRAY [0..3] OF UInt32; { array of 128 bits }
END;
CONST
kVoiceCountDynamic = -1; { constant to use to specify dynamic voicing }
TYPE
ToneDescriptionPtr = ^ToneDescription;
ToneDescription = RECORD
synthesizerType: BigEndianOSType; { synthesizer type }
synthesizerName: Str31; { name of instantiation of synth }
instrumentName: Str31; { preferred name for human use }
instrumentNumber: BigEndianLong; { inst-number used if synth-name matches }
gmNumber: BigEndianLong; { Best matching general MIDI number }
END;
CONST
kFirstGMInstrument = $00000001;
kLastGMInstrument = $00000080;
kFirstGSInstrument = $00000081;
kLastGSInstrument = $00003FFF;
kFirstDrumkit = $00004000; { (first value is "no drum". instrument numbers from 16384->16384+128 are drumkits, and for GM they are _defined_ drumkits! }
kLastDrumkit = $00004080;
kFirstROMInstrument = $00008000;
kLastROMInstrument = $0000FFFF;
kFirstUserInstrument = $00010000;
kLastUserInstrument = $0001FFFF;
{ InstrumentMatch }
kInstrumentMatchSynthesizerType = 1;
kInstrumentMatchSynthesizerName = 2;
kInstrumentMatchName = 4;
kInstrumentMatchNumber = 8;
kInstrumentMatchGMNumber = 16;
kInstrumentMatchGSNumber = 32;
{ KnobFlags }
kKnobBasic = 8; { knob shows up in certain simplified lists of knobs }
kKnobReadOnly = 16; { knob value cannot be changed by user or with a SetKnob call }
kKnobInterruptUnsafe = 32; { only alter this knob from foreground task time (may access toolbox) }
kKnobKeyrangeOverride = 64; { knob can be overridden within a single keyrange (software synth only) }
kKnobGroupStart = 128; { knob is first in some logical group of knobs }
kKnobFixedPoint8 = 1024;
kKnobFixedPoint16 = 2048; { One of these may be used at a time. }
kKnobTypeNumber = $00;
kKnobTypeGroupName = $1000; { "knob" is really a group name for display purposes }
kKnobTypeBoolean = $2000; { if range is greater than 1, its a multi-checkbox field }
kKnobTypeNote = $3000; { knob range is equivalent to MIDI keys }
kSetAtomicInstCallerTosses = $04; { the caller isn't keeping a copy around (for NASetAtomicInstrument) }
kSetAtomicInstCallerGuarantees = $08; { the caller guarantees a copy is around }
kSetAtomicInstInterruptSafe = $10; { dont move memory at this time (but process at next task time) }
kSetAtomicInstDontPreprocess = $80; { perform no further preprocessing because either 1)you know the instrument is digitally clean, or 2) you got it from a GetPartAtomic }
kInstrumentNamesModifiable = 1;
kInstrumentNamesBoth = 2;
{
* Structures specific to the GenericMusicComponent
kGenericMusicDoMIDI = $01; { implement normal MIDI messages for note, controllers, and program changes 0-127 }
kGenericMusicBank0 = $02; { implement instrument bank changes on controller 0 }
kGenericMusicBank32 = $04; { implement instrument bank changes on controller 32 }
kGenericMusicErsatzMIDI = $08; { construct MIDI packets, but send them to the derived component }
kGenericMusicCallKnobs = $10; { call the derived component with special knob format call }
kGenericMusicCallParts = $20; { call the derived component with special part format call }
kGenericMusicCallInstrument = $40; { call MusicDerivedSetInstrument for MusicSetInstrument calls }
kGenericMusicCallNumber = $80; { call MusicDerivedSetPartInstrumentNumber for MusicSetPartInstrumentNumber calls, & don't send any C0 or bank stuff }
kGenericMusicCallROMInstrument = $0100; { call MusicSetInstrument for MusicSetPartInstrumentNumber for "ROM" instruments, passing params from the ROMi resource }
kGenericMusicAllDefaults = $0200; { indicates that when a new instrument is recalled, all knobs are reset to DEFAULT settings. True for GS modules }
FUNCTION MusicGetDescription(mc: MusicComponent; VAR sd: SynthesizerDescription): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0004, $0001, $7000, $A82A;
{$ENDC}
FUNCTION MusicGetPart(mc: MusicComponent; part: LONGINT; VAR midiChannel: LONGINT; VAR polyphony: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $000C, $0002, $7000, $A82A;
{$ENDC}
FUNCTION MusicSetPart(mc: MusicComponent; part: LONGINT; midiChannel: LONGINT; polyphony: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $000C, $0003, $7000, $A82A;
{$ENDC}
FUNCTION MusicSetPartInstrumentNumber(mc: MusicComponent; part: LONGINT; instrumentNumber: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $0004, $7000, $A82A;
{$ENDC}
FUNCTION MusicGetPartInstrumentNumber(mc: MusicComponent; part: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0004, $0005, $7000, $A82A;
{$ENDC}
FUNCTION MusicStorePartInstrument(mc: MusicComponent; part: LONGINT; instrumentNumber: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $0006, $7000, $A82A;
{$ENDC}
FUNCTION MusicGetPartAtomicInstrument(mc: MusicComponent; part: LONGINT; VAR ai: AtomicInstrument; flags: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $000C, $0009, $7000, $A82A;
{$ENDC}
FUNCTION MusicSetPartAtomicInstrument(mc: MusicComponent; part: LONGINT; aiP: AtomicInstrumentPtr; flags: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $000C, $000A, $7000, $A82A;
{$ENDC}
{ Obsolete calls }
FUNCTION MusicGetInstrumentKnobDescriptionObsolete(mc: MusicComponent; knobIndex: LONGINT; mkd: UNIV Ptr): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $000D, $7000, $A82A;
{$ENDC}
FUNCTION MusicGetDrumKnobDescriptionObsolete(mc: MusicComponent; knobIndex: LONGINT; mkd: UNIV Ptr): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $000E, $7000, $A82A;
{$ENDC}
FUNCTION MusicGetKnobDescriptionObsolete(mc: MusicComponent; knobIndex: LONGINT; mkd: UNIV Ptr): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $000F, $7000, $A82A;
{$ENDC}
FUNCTION MusicGetPartKnob(mc: MusicComponent; part: LONGINT; knobID: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $0010, $7000, $A82A;
{$ENDC}
FUNCTION MusicSetPartKnob(mc: MusicComponent; part: LONGINT; knobID: LONGINT; knobValue: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $000C, $0011, $7000, $A82A;
{$ENDC}
FUNCTION MusicGetKnob(mc: MusicComponent; knobID: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0004, $0012, $7000, $A82A;
{$ENDC}
FUNCTION MusicSetKnob(mc: MusicComponent; knobID: LONGINT; knobValue: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $0013, $7000, $A82A;
{$ENDC}
FUNCTION MusicGetPartName(mc: MusicComponent; part: LONGINT; name: StringPtr): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $0014, $7000, $A82A;
{$ENDC}
FUNCTION MusicSetPartName(mc: MusicComponent; part: LONGINT; name: StringPtr): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $0015, $7000, $A82A;
{$ENDC}
FUNCTION MusicFindTone(mc: MusicComponent; VAR td: ToneDescription; VAR libraryIndexOut: LONGINT; VAR fit: UInt32): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $000C, $0016, $7000, $A82A;
{$ENDC}
FUNCTION MusicPlayNote(mc: MusicComponent; part: LONGINT; pitch: LONGINT; velocity: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $000C, $0017, $7000, $A82A;
{$ENDC}
FUNCTION MusicResetPart(mc: MusicComponent; part: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0004, $0018, $7000, $A82A;
{$ENDC}
FUNCTION MusicSetPartController(mc: MusicComponent; part: LONGINT; controllerNumber: MusicController; controllerValue: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $000C, $0019, $7000, $A82A;
{$ENDC}
FUNCTION MusicGetPartController(mc: MusicComponent; part: LONGINT; controllerNumber: MusicController): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $001A, $7000, $A82A;
{$ENDC}
FUNCTION MusicGetMIDIProc(mc: MusicComponent; VAR midiSendProc: MusicMIDISendUPP; VAR refCon: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $001B, $7000, $A82A;
{$ENDC}
FUNCTION MusicSetMIDIProc(mc: MusicComponent; midiSendProc: MusicMIDISendUPP; refCon: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $001C, $7000, $A82A;
{$ENDC}
FUNCTION MusicGetInstrumentNames(mc: MusicComponent; modifiableInstruments: LONGINT; VAR instrumentNames: Handle; VAR instrumentCategoryLasts: Handle; VAR instrumentCategoryNames: Handle): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0010, $001D, $7000, $A82A;
{$ENDC}
FUNCTION MusicGetDrumNames(mc: MusicComponent; modifiableInstruments: LONGINT; VAR instrumentNumbers: Handle; VAR instrumentNames: Handle): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $000C, $001E, $7000, $A82A;
{$ENDC}
FUNCTION MusicGetMasterTune(mc: MusicComponent): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0000, $001F, $7000, $A82A;
{$ENDC}
FUNCTION MusicSetMasterTune(mc: MusicComponent; masterTune: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0004, $0020, $7000, $A82A;
{$ENDC}
FUNCTION MusicGetInstrumentAboutInfo(mc: MusicComponent; part: LONGINT; VAR iai: InstrumentAboutInfo): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $0022, $7000, $A82A;
{$ENDC}
FUNCTION MusicGetDeviceConnection(mc: MusicComponent; index: LONGINT; VAR id1: LONGINT; VAR id2: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $000C, $0023, $7000, $A82A;
{$ENDC}
FUNCTION MusicUseDeviceConnection(mc: MusicComponent; id1: LONGINT; id2: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $0024, $7000, $A82A;
{$ENDC}
FUNCTION MusicGetKnobSettingStrings(mc: MusicComponent; knobIndex: LONGINT; isGlobal: LONGINT; VAR settingsNames: Handle; VAR settingsCategoryLasts: Handle; VAR settingsCategoryNames: Handle): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0014, $0025, $7000, $A82A;
{$ENDC}
FUNCTION MusicGetMIDIPorts(mc: MusicComponent; VAR inputPortCount: LONGINT; VAR outputPortCount: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $0026, $7000, $A82A;
{$ENDC}
FUNCTION MusicSendMIDI(mc: MusicComponent; portIndex: LONGINT; VAR mp: MusicMIDIPacket): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $0027, $7000, $A82A;
{$ENDC}
FUNCTION MusicReceiveMIDI(mc: MusicComponent; readHook: MusicMIDIReadHookUPP; refCon: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $0028, $7000, $A82A;
{$ENDC}
FUNCTION MusicStartOffline(mc: MusicComponent; VAR numChannels: UInt32; VAR sampleRate: UnsignedFixed; VAR sampleSize: UInt16; dataProc: MusicOfflineDataUPP; dataProcRefCon: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0014, $0029, $7000, $A82A;
{$ENDC}
FUNCTION MusicSetOfflineTimeTo(mc: MusicComponent; newTimeStamp: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0004, $002A, $7000, $A82A;
{$ENDC}
FUNCTION MusicGetInstrumentKnobDescription(mc: MusicComponent; knobIndex: LONGINT; VAR mkd: KnobDescription): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $002B, $7000, $A82A;
{$ENDC}
FUNCTION MusicGetDrumKnobDescription(mc: MusicComponent; knobIndex: LONGINT; VAR mkd: KnobDescription): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $002C, $7000, $A82A;
{$ENDC}
FUNCTION MusicGetKnobDescription(mc: MusicComponent; knobIndex: LONGINT; VAR mkd: KnobDescription): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $002D, $7000, $A82A;
{$ENDC}
FUNCTION MusicGetInfoText(mc: MusicComponent; selector: LONGINT; VAR textH: Handle; VAR styleH: Handle): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $000C, $002E, $7000, $A82A;
{$ENDC}
CONST
kGetInstrumentInfoNoBuiltIn = $01;
kGetInstrumentInfoMidiUserInst = $02;
kGetInstrumentInfoNoIText = $04;
FUNCTION MusicGetInstrumentInfo(mc: MusicComponent; getInstrumentInfoFlags: LONGINT; VAR infoListH: InstrumentInfoListHandle): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $002F, $7000, $A82A;
{$ENDC}
FUNCTION MusicTask(mc: MusicComponent): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0000, $0031, $7000, $A82A;
{$ENDC}
FUNCTION MusicSetPartInstrumentNumberInterruptSafe(mc: MusicComponent; part: LONGINT; instrumentNumber: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $0032, $7000, $A82A;
{$ENDC}
FUNCTION MusicSetPartSoundLocalization(mc: MusicComponent; part: LONGINT; data: Handle): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $0033, $7000, $A82A;
{$ENDC}
FUNCTION MusicGenericConfigure(mc: MusicComponent; mode: LONGINT; flags: LONGINT; baseResID: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $000C, $0100, $7000, $A82A;
{$ENDC}
FUNCTION MusicGenericGetPart(mc: MusicComponent; partNumber: LONGINT; VAR part: GCPartPtr): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $0101, $7000, $A82A;
{$ENDC}
FUNCTION MusicGenericGetKnobList(mc: MusicComponent; knobType: LONGINT; VAR gkdlH: GenericKnobDescriptionListHandle): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $0102, $7000, $A82A;
{$ENDC}
FUNCTION MusicGenericSetResourceNumbers(mc: MusicComponent; resourceIDH: Handle): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0004, $0103, $7000, $A82A;
{$ENDC}
FUNCTION MusicDerivedMIDISend(mc: MusicComponent; VAR packet: MusicMIDIPacket): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0004, $0200, $7000, $A82A;
{$ENDC}
FUNCTION MusicDerivedSetKnob(mc: MusicComponent; knobType: LONGINT; knobNumber: LONGINT; knobValue: LONGINT; partNumber: LONGINT; VAR p: GCPart; VAR gkd: GenericKnobDescription): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0018, $0201, $7000, $A82A;
{$ENDC}
FUNCTION MusicDerivedSetPart(mc: MusicComponent; partNumber: LONGINT; VAR p: GCPart): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $0202, $7000, $A82A;
{$ENDC}
FUNCTION MusicDerivedSetInstrument(mc: MusicComponent; partNumber: LONGINT; VAR p: GCPart): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $0203, $7000, $A82A;
{$ENDC}
FUNCTION MusicDerivedSetPartInstrumentNumber(mc: MusicComponent; partNumber: LONGINT; VAR p: GCPart): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $0204, $7000, $A82A;
{$ENDC}
FUNCTION MusicDerivedSetMIDI(mc: MusicComponent; midiProc: MusicMIDISendUPP; refcon: LONGINT; midiChannel: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $000C, $0205, $7000, $A82A;
{$ENDC}
FUNCTION MusicDerivedStorePartInstrument(mc: MusicComponent; partNumber: LONGINT; VAR p: GCPart; instrumentNumber: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $000C, $0206, $7000, $A82A;
{$ENDC}
FUNCTION MusicDerivedOpenResFile(mc: MusicComponent): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0000, $0207, $7000, $A82A;
{$ENDC}
FUNCTION MusicDerivedCloseResFile(mc: MusicComponent; resRefNum: INTEGER): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0002, $0208, $7000, $A82A;
{$ENDC}
{ Mask bit for returned value by InstrumentFind. }
InstrumentLibraryITxt: QTAtomContainer; { itext/name atoms for instruments }
GMinstrumentCount: LONGINT;
GMinstrumentInfo: GMInstrumentInfoHandle;
GMdrumCount: LONGINT;
GMdrumInfo: GMInstrumentInfoHandle;
nonGMinstrumentCount: LONGINT;
nonGMinstrumentInfo: nonGMInstrumentInfoHandle;
END;
InstCompInfoHandle = ^InstCompInfoPtr;
FUNCTION InstrumentGetInst(ci: ComponentInstance; instID: LONGINT; VAR atomicInst: AtomicInstrument; flags: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $000C, $0001, $7000, $A82A;
{$ENDC}
FUNCTION InstrumentGetInfo(ci: ComponentInstance; getInstrumentInfoFlags: LONGINT; VAR instInfo: InstCompInfoHandle): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $0002, $7000, $A82A;
{$ENDC}
FUNCTION InstrumentInitialize(ci: ComponentInstance; initFormat: LONGINT; initParams: UNIV Ptr): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $0003, $7000, $A82A;
{$ENDC}
FUNCTION InstrumentOpenComponentResFile(ci: ComponentInstance; VAR resFile: INTEGER): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0004, $0004, $7000, $A82A;
{$ENDC}
FUNCTION InstrumentCloseComponentResFile(ci: ComponentInstance; resFile: INTEGER): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0002, $0005, $7000, $A82A;
{$ENDC}
FUNCTION InstrumentGetComponentRefCon(ci: ComponentInstance; VAR refCon: UNIV Ptr): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0004, $0006, $7000, $A82A;
{$ENDC}
FUNCTION InstrumentSetComponentRefCon(ci: ComponentInstance; refCon: UNIV Ptr): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0004, $0007, $7000, $A82A;
{$ENDC}
FUNCTION InstrumentGetSynthesizerType(ci: ComponentInstance; VAR synthesizerType: OSType): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0004, $0008, $7000, $A82A;
{$ENDC}
{--------------------------
Types
--------------------------}
CONST
kNoteRequestNoGM = 1; { dont degrade to a GM synth }
kNoteRequestNoSynthType = 2; { dont degrade to another synth of same type but different name }
kNoteRequestSynthMustMatch = 4; { synthType must be a match, including kGMSynthComponentSubType }
TYPE
NoteAllocator = ComponentInstance;
NoteRequestInfoPtr = ^NoteRequestInfo;
NoteRequestInfo = RECORD
flags: SInt8; { 1: dont accept GM match, 2: dont accept same-synth-type match }
reserved: SInt8; { must be zero }
polyphony: BigEndianShort; { Maximum number of voices }
typicalPolyphony: BigEndianFixed; { Hint for level mixing }
END;
NoteRequestPtr = ^NoteRequest;
NoteRequest = RECORD
info: NoteRequestInfo;
tone: ToneDescription;
END;
NoteChannel = ^LONGINT;
CONST
kPickDontMix = 1; { dont mix instruments with drum sounds }
kPickSameSynth = 2; { only allow the same device that went in, to come out }
kPickUserInsts = 4; { show user insts in addition to ROM voices }
kPickEditAllowEdit = 8; { lets user switch over to edit mode }
kPickEditAllowPick = 16; { lets the user switch over to pick mode }
kPickEditSynthGlobal = 32; { edit the global knobs of the synth }
kPickEditControllers = 64; { edit the controllers of the notechannel }
kNoteAllocatorComponentType = 'nota';
{--------------------------------
Note Allocator Prototypes
--------------------------------}
FUNCTION NARegisterMusicDevice(na: NoteAllocator; synthType: OSType; VAR name: Str31; VAR connections: SynthesizerConnections): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $000C, $0000, $7000, $A82A;
{$ENDC}
FUNCTION NAUnregisterMusicDevice(na: NoteAllocator; index: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0004, $0001, $7000, $A82A;
{$ENDC}
FUNCTION NAGetRegisteredMusicDevice(na: NoteAllocator; index: LONGINT; VAR synthType: OSType; VAR name: Str31; VAR connections: SynthesizerConnections; VAR mc: MusicComponent): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0014, $0002, $7000, $A82A;
{$ENDC}
FUNCTION NASaveMusicConfiguration(na: NoteAllocator): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0000, $0003, $7000, $A82A;
{$ENDC}
FUNCTION NANewNoteChannel(na: NoteAllocator; VAR noteRequest: NoteRequest; VAR outChannel: NoteChannel): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $0004, $7000, $A82A;
{$ENDC}
FUNCTION NADisposeNoteChannel(na: NoteAllocator; noteChannel: NoteChannel): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0004, $0005, $7000, $A82A;
{$ENDC}
FUNCTION NAGetNoteChannelInfo(na: NoteAllocator; noteChannel: NoteChannel; VAR index: LONGINT; VAR part: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $000C, $0006, $7000, $A82A;
{$ENDC}
FUNCTION NAPrerollNoteChannel(na: NoteAllocator; noteChannel: NoteChannel): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0004, $0007, $7000, $A82A;
{$ENDC}
FUNCTION NAUnrollNoteChannel(na: NoteAllocator; noteChannel: NoteChannel): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0004, $0008, $7000, $A82A;
{$ENDC}
FUNCTION NASetNoteChannelVolume(na: NoteAllocator; noteChannel: NoteChannel; volume: Fixed): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $000B, $7000, $A82A;
{$ENDC}
FUNCTION NAResetNoteChannel(na: NoteAllocator; noteChannel: NoteChannel): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0004, $000C, $7000, $A82A;
{$ENDC}
FUNCTION NAPlayNote(na: NoteAllocator; noteChannel: NoteChannel; pitch: LONGINT; velocity: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $000C, $000D, $7000, $A82A;
{$ENDC}
FUNCTION NASetController(na: NoteAllocator; noteChannel: NoteChannel; controllerNumber: LONGINT; controllerValue: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $000C, $000E, $7000, $A82A;
{$ENDC}
FUNCTION NASetKnob(na: NoteAllocator; noteChannel: NoteChannel; knobNumber: LONGINT; knobValue: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $000C, $000F, $7000, $A82A;
{$ENDC}
FUNCTION NAFindNoteChannelTone(na: NoteAllocator; noteChannel: NoteChannel; VAR td: ToneDescription; VAR instrumentNumber: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $000C, $0010, $7000, $A82A;
{$ENDC}
FUNCTION NASetInstrumentNumber(na: NoteAllocator; noteChannel: NoteChannel; instrumentNumber: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0008, $0011, $7000, $A82A;
{$ENDC}
FUNCTION NAPickInstrument(na: NoteAllocator; filterProc: ModalFilterUPP; prompt: StringPtr; VAR sd: ToneDescription; flags: UInt32; refCon: LONGINT; reserved1: LONGINT; reserved2: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0010, $001D, $7000, $A82A;
{$ENDC}
FUNCTION TuneGetPartMix(tp: TunePlayer; partNumber: UInt32; VAR volumeOut: LONGINT; VAR balanceOut: LONGINT; VAR mixFlagsOut: LONGINT): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2F3C, $0010, $001E, $7000, $A82A;
{$ENDC}
TYPE
MusicOpWord = UInt32;
MusicOpWordPtr = ^UInt32;
{ QuickTime Music Track Event Formats:
At this time, QuickTime music tracks support 5 different event types -- REST events,
short NOTE events, short CONTROL events, short GENERAL events, Long NOTE events,
kMarkerEventValueFieldWidth = 16; { General Events }
kGeneralEventSubtypeFieldPos = 16; { in the last long word }
kGeneralEventSubtypeFieldWidth = 14;
kGeneralEventLengthFieldPos = 0; { in the 1st & last long words }
kGeneralEventLengthFieldWidth = 16;
{$IFC TARGET_RT_LITTLE_ENDIAN }
kEndMarkerValue = $00000060;
{$ELSEC}
kEndMarkerValue = $60000000;
{$ENDC} {TARGET_RT_LITTLE_ENDIAN}
{ General Event Defined Types }
kGeneralEventNoteRequest = 1; { Encapsulates NoteRequest data structure }
kGeneralEventPartKey = 4;
kGeneralEventTuneDifference = 5; { Contains a standard sequence, with end marker, for the tune difference of a sequence piece (halts QuickTime 2.0 Music) }
kGeneralEventAtomicInstrument = 6; { Encapsulates AtomicInstrument record }
kGeneralEventMIDIChannel = 8; { used in tune header, one longword identifies the midi channel it originally came from }
kGeneralEventPartChange = 9; { used in tune sequence, one longword identifies the tune part which can now take over this part's note channel (similar to program change) (halts QuickTime 2.0 Music) }
kGeneralEventNoOp = 10; { guaranteed to do nothing and be ignored. (halts QuickTime 2.0 Music) }
kGeneralEventUsedNotes = 11; { four longwords specifying which midi notes are actually used, 0..127 msb to lsb }
kGeneralEventPartMix = 12; { three longwords: Fixed volume, long balance, long flags }
{ Marker Event Defined Types // marker is 60 ee vv vv in hex, where e = event type, and v = value }
kMarkerEventEnd = 0; { marker type 0 means: value 0 - stop, value != 0 - ignore }
kMarkerEventBeat = 1; { value 0 = single beat; anything else is 65536ths-of-a-beat (quarter note) }
kMarkerEventTempo = 2; { value same as beat marker, but indicates that a tempo event should be computed (based on where the next beat or tempo marker is) and emitted upon export }
kCurrentlyNativeEndian = 1;
kCurrentlyNotNativeEndian = 2;
{ UPP call backs }
uppMusicMIDISendProcInfo = $00000FF0;
uppMusicMIDIReadHookProcInfo = $000003F0;
uppMusicOfflineDataProcInfo = $00000FF0;
uppTuneCallBackProcInfo = $000003C0;
uppTunePlayCallBackProcInfo = $00000FC0;
FUNCTION NewMusicMIDISendProc(userRoutine: MusicMIDISendProcPtr): MusicMIDISendUPP;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2E9F;
{$ENDC}
FUNCTION NewMusicMIDIReadHookProc(userRoutine: MusicMIDIReadHookProcPtr): MusicMIDIReadHookUPP;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2E9F;
{$ENDC}
FUNCTION NewMusicOfflineDataProc(userRoutine: MusicOfflineDataProcPtr): MusicOfflineDataUPP;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2E9F;
{$ENDC}
FUNCTION NewTuneCallBackProc(userRoutine: TuneCallBackProcPtr): TuneCallBackUPP;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2E9F;
{$ENDC}
FUNCTION NewTunePlayCallBackProc(userRoutine: TunePlayCallBackProcPtr): TunePlayCallBackUPP;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $2E9F;
{$ENDC}
FUNCTION CallMusicMIDISendProc(self: ComponentInstance; refCon: LONGINT; VAR mmp: MusicMIDIPacket; userRoutine: MusicMIDISendUPP): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $205F, $4E90;
{$ENDC}
FUNCTION CallMusicMIDIReadHookProc(VAR mp: MusicMIDIPacket; myRefCon: LONGINT; userRoutine: MusicMIDIReadHookUPP): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $205F, $4E90;
{$ENDC}
FUNCTION CallMusicOfflineDataProc(SoundData: Ptr; numBytes: LONGINT; myRefCon: LONGINT; userRoutine: MusicOfflineDataUPP): ComponentResult;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}